//
// Created by cheng on 2021/02/14.
//

#include <iostream>
#include <math.h>

using namespace std;

struct Point {
    double x, y;
};

void Print(Point t) {
    cout << t.x << " " << t.y << endl;
}

void koth(Point a, Point b, int n) {
    if (n == 0) {
        return;
    }
    double th = M_PI * 60.0 / 180;
    Point s, u, t;
    s.x = (2.0 * a.x + 1.0 * b.x) / 3.0;
    s.y = (2.0 * a.y + 1.0 * b.y) / 3.0;
    t.x = (1.0 * a.x + 2.0 * b.x) / 3.0;
    t.y = (1.0 * a.y + 2.0 * b.y) / 3.0;
    u.x = (t.x - s.x) * cos(th) - (t.y - s.y) * sin(th) + s.x;
    u.y = (t.x - s.x) * sin(th) + (t.y - s.y) * cos(th) + s.y;
    Print(s);
    Print(u);
    Print(t);
    koth(a, s, n-1);
    koth(s, u, n-1);
    koth(u, t, n-1);
    koth(t, b, n-1);
}

int main() {
    Point a = {0, 0} , b = {100, 0};
    Print(a);
    koth(a, b, 1);
    Print(b);
}
